







Algorithms..::ReplaceInPlace<(Of <T>)> Method (IList<(Of <T>)>, T, T, IEqualityComparer<(Of <T>)>) |
See Also |
![]() ![]() |
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Replace all items in a list or array equal to a particular value with another values.
The replacement is done in-place, changing
the list. A passed IEqualityComparer is used to determine equality.
Namespace: Wintellect.PowerCollections
Assembly:
PowerCollections (in PowerCollections.dll)
Syntax
C# |
---|
public static void ReplaceInPlace<T>( IList<T> list, T itemFind, T replaceWith, IEqualityComparer<T> equalityComparer ) |
Visual Basic (Declaration) |
---|
Public Shared Sub ReplaceInPlace(Of T) ( _ list As IList(Of T), _ itemFind As T, _ replaceWith As T, _ equalityComparer As IEqualityComparer(Of T) _ ) |
Visual C++ |
---|
public: generic<typename T> static void ReplaceInPlace ( IList<T>^ list, T itemFind, T replaceWith, IEqualityComparer<T>^ equalityComparer ) |
Parameters
- list
- IList<(Of <T>)>
The list or array to process.
- itemFind
- T
The value to find and replace within .
- replaceWith
- T
The new value to replace with.
- equalityComparer
- IEqualityComparer<(Of <T>)>
The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called.
Type Parameters
- T
Remarks
Although arrays cast to IList<T> are normally read-only, this method
will work correctly and modify an array passed as list.
See Also
Algorithms Class
Wintellect.PowerCollections Namespace